As a lazy user, I want to get alerted when website goes down.
Solution:
$homepage = file_get_contents('http://,monitoring--domain.com/'); if(strlen($homepage) > 0) { echo "Got response, no action"; }else { echo "No response from server, send out email..."; $to = '[email protected]'; $subject = 'Weak up, you website is down!'; $message = 'Weak up, you website is down!'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); }
Grep <->
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.